package com.wwwarehouse.common.tools;

import android.graphics.Paint;

/**
 * @author : mundane
 * @time : 2017/6/23 13:06
 * @description :
 * @file : CanvasUtils.java
 */

public class CanvasUtils {
	public static Paint createTextPaint(int paintColor, int textSize) {
		Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
		paint.setColor(paintColor);
		paint.setTextSize(textSize);
		return paint;
	}

	public static Paint createPaint(int paintColor, Paint.Style style, int width) {
		Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
		paint.setColor(paintColor);
		paint.setStyle(style);
		paint.setStrokeWidth(width);
		return paint;
	}

	public static Paint createPaint(int paintColor, Paint.Style style, int width, Paint.Cap cap) {
		Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
		paint.setColor(paintColor);
		paint.setStyle(style);
		paint.setStrokeWidth(width);
		paint.setStrokeCap(cap);
		return paint;
	}
}
